/*
 * Copyright (c) 2025 Oracle and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.helidon.transaction.jta;

import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionSynchronizationRegistry;
import jakarta.transaction.UserTransaction;

/**
 * Jakarta Transaction service provider.
 * <p>
 * Implemented by specific Jakarta Transaction implementation provider
 * as Helidon {@code io.helidon.service.registry.Service.Singleton}.
 */
public interface JtaProvider {

    /**
     * Returns {@link TransactionManager} instance.
     * Returned value shall not be {@code null}.
     *
     * @return the {@link TransactionManager} instance
     */
    TransactionManager transactionManager();

    /**
     * Returns {@link UserTransaction} instance.
     * Returned value shall not be {@code null}.
     *
     * @return the {@link UserTransaction} instance
     */
    UserTransaction userTransaction();

    /**
     * Returns {@link TransactionSynchronizationRegistry} instance.
     * Returned value shall not be {@code null}.
     *
     * @return the {@link TransactionSynchronizationRegistry} instance
     */
    TransactionSynchronizationRegistry transactionSynchronizationRegistry();

}
